]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Connect before destroying
authorAlessandro Bono <alessandro.bono369@gmail.com>
Sat, 14 Jan 2023 16:00:42 +0000 (17:00 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 17 Jan 2023 13:58:06 +0000 (13:58 +0000)
Since commit 7bd98f3f5fb7e0d1220646b8a4ee7073534a8e8f animateOutAndDestroy() destroys
the placeholder right away when animations are disabled. Connect to the destroy signal
before calling the function.

This fixes the following error:
Gjs-CRITICAL **: 16:51:35.195: Object .Gjs_ui_dash_DragPlaceholderItem (0x55b9a946da20),
has been already disposed — impossible to connect to any signal on it. This might be
caused by the object having been destroyed from C code using something such as destroy(),
dispose(), or remove() vfuncs.
== Stack trace for context 0x55b9a70d08f0 ==
 #0   7ffe161bd070 b   resource:///org/gnome/shell/ui/dash.js:835 (df3d61d32e0 @ 98)
 #1   7ffe161bd170 b   resource:///org/gnome/shell/ui/dash.js:901 (df3d61d33d0 @ 779)
 #2   7ffe161bd290 b   resource:///org/gnome/shell/ui/dnd.js:562 (3d4da0cfd420 @ 909)
 #3   7ffe161bd360 b   self-hosted:1115 (3d4da0c7ef10 @ 407)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2604>

js/ui/dash.js

index d546ee2558a3a0dff005c5bcd1ae203145c474e7..1514d2999cc71f884a7f69dc267743dfbb9d4e23 100644 (file)
@@ -831,10 +831,10 @@ var Dash = GObject.registerClass({
     _clearDragPlaceholder() {
         if (this._dragPlaceholder) {
             this._animatingPlaceholdersCount++;
-            this._dragPlaceholder.animateOutAndDestroy();
             this._dragPlaceholder.connect('destroy', () => {
                 this._animatingPlaceholdersCount--;
             });
+            this._dragPlaceholder.animateOutAndDestroy();
             this._dragPlaceholder = null;
         }
         this._dragPlaceholderPos = -1;